﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using eSchoolbag.Utility;

namespace eSchoolbag
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
		private URLProvider _URLProvider = new URLProvider();

		public MainWindow()
        {
            InitializeComponent();
        }

        public void DragWindow(object sender, MouseButtonEventArgs args)
        {
            this.DragMove();
        }

        public void CloseWindow(object sender, RoutedEventArgs args)
        {
			BrowserWindow.GetInstance().Close();
            this.Close();
        }

		private void BtnSelection_Click(object sender, RoutedEventArgs e)
		{
			//System.Diagnostics.Process.Start("http://app-api.jiaoxueyun.com/select.html");
			BrowserWindow.GetInstance().ShowAndNavigate2("文本接收器", _URLProvider.URL1);
		}

		private void BtnWritting_Click(object sender, RoutedEventArgs e)
		{
			//System.Diagnostics.Process.Start("http://app-api.jiaoxueyun.com/writing-monitor.html");
			BrowserWindow.GetInstance().ShowAndNavigate2("图片接收器", _URLProvider.URL2);
		}

		private void Window_MouseDoubleClick(object sender, MouseButtonEventArgs e)
		{
			this.Topmost = false;

			ConfigWindow config = new ConfigWindow();
			bool? result = config.ShowDialog();

			if (result.HasValue && result.Value == true)
			{
				// Read the value again
			}

			this.Topmost = true;
			e.Handled = true;
		}
    }
}
